package cn.cjlmonster.hyouka_assistant.json;

import androidx.annotation.NonNull;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;

/**
 * ParameterizedTypeImpl
 * @author cjl
 */
public class ParameterizedTypeImpl<T> implements ParameterizedType {

    private final Class<T> clazz;

    public ParameterizedTypeImpl(Class<T> clz) {
        clazz = clz;
    }

    @NonNull
    @Override
    public Type[] getActualTypeArguments() {
        return new Type[]{clazz};
    }

    @NonNull
    @Override
    public Type getRawType() {
        return List.class;
    }

    @Override
    public Type getOwnerType() {
        return null;
    }
}